import express from "express"
import cookieParser from "cookie-parser"
import path from "path"
import authRoutes from "./routes/auth.route.js"
import movieRoutes from "./routes/movie.route.js"
import { ENV_VARS } from "./config/envVars.js"
import { connectDB } from "./config/db.js"


const app = express()
const PORT = ENV_VARS.PORT || 5000

app.use(express.json())
app.use(cookieParser())

app.use("/api/v1/auth", authRoutes)
app.use("/api/v1/movie", movieRoutes)


app.listen(PORT, () => {
    console.log("Netflix Backend Server Start At: http://localhost:" + PORT)
    connectDB()
})